<template>
  <div class="houselist-v3">
    <div class="inner">
      <div class="cover">
        <img :src="houselist.data.image.url" alt="" />
      </div>
      <div class="content">
        <div class="location">
          <img src="@/assets/img/home/location.png" alt="" />
          <div class="text">{{ houselist.data.location }}</div>
        </div>
        <div class="name">{{ houselist.data.houseName }}</div>
        <div class="summary">
          {{ houselist.data.summaryText }}
        </div>
        <div class="price">
          <div class="new">￥{{ houselist.data.finalPrice }}</div>
          <div class="old">￥{{ houselist.data.productPrice }}</div>
          <div class="tip" v-if="houselist.data?.priceTipBadge?.text">
            {{ houselist.data?.priceTipBadge?.text }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  houselist: {
    type: Object,
    default: () => ({}),
  },
})
</script>

<style lang="less" scoped>
.houselist-v3 {
  width: 50%;
  .inner {
    padding: 5px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    .cover {
      border: 1px solid #fff;
      img {
        width: 100%;
        border-radius: 6px;
      }
    }
    .content {
      margin-top: 3px;
      width: 92%;
      height: 96px;
      display: flex;
      flex-direction: column;
      .location {
        display: flex;
        margin-top: 3px;
        img {
          width: 10%;
          margin-right: 3px;
        }
        .text {
          font-size: 13px;
          color: #6a6868;
          text-shadow: 2px #6a6868;
        }
      }
      .name {
        font-size: 13px;
        margin-top: 5px;
        text-shadow: 0.4px 0.2px #333;

        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }
      .summary {
        margin-top: 5px;
        font-size: 13px;
        color: #6a6868;
        text-shadow: 2px #6a6868;
      }
      .price {
        margin-top: 5px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .new {
          color: var(--primary-color);
          font-size: 11px;
        }
        .old {
          margin-left: 2px;
          text-decoration: line-through;
          font-size: 11px;
          color: #aaa;
        }
        .tip {
          margin-left: 2px;
          color: #fff;
          font-size: 8px;
          padding: 1px 2px;
          border: 1px solid #fff;
          background-image: linear-gradient(to left, #fa8989, #ca4646);
          border-radius: 13px;
        }
      }
    }
  }
}
</style>
